<?php

require( realpath('..') . '/includes/admin.php' );

auth();
$dora->database();

if( action('update') ) {
	extract($_POST);
	
	$sql = "update article set title='$title', sort='$sort', author='$author', source='$source', content='$content' where id=$id";
	$dora->db->query($sql);
	
	$dora->lib('message');
	$dora->message->set('修改房源信息成功');
	
	$dora->view('house_fo');
}
else {
	$article_id = $_GET['id'];
	$article = $dora->db->get_result('select * from article where id=' . $article_id);
	$dora->set('article', $article);
	
	$dora->view('article_update');
}

?>